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