UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'acBR5vROYE0IrTYiMpfWkShr24Ob9GconVkfnSCE+ew='
WHERE
key_id = '536eb55515a4fb32d863e9eba8a42cea1704109019d17b27d5be0b662d08694c'
AND (
token = 'acBR5vROYE0IrTYiMpfWkShr24Ob9GconVkfnSCE+ew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)