UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JneoZ3l0iMcfYv16Dj5BfZn+UurCBN3b0Ia+K/XymNU='
WHERE
key_id = 'aceeccfeadeb569f53a0db0f6842054f39800fefc4953f0a2f72e31bd6bf0c69'
AND (
token = 'JneoZ3l0iMcfYv16Dj5BfZn+UurCBN3b0Ia+K/XymNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)