UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bODAx09dMVSukUGmRBu12cWHdQjD3kGujkHQx8n7o7U='
WHERE
key_id = 'fd30029b0770c05e0b7a746075e26e0056b0f67077099810be907d86b3b735cb'
AND (
token = 'bODAx09dMVSukUGmRBu12cWHdQjD3kGujkHQx8n7o7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)