UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMdcJWJ9qEPEC0FfVKHDPkY68zlHVJRpdmZU5YlTeNc='
WHERE
key_id = '42eb12c16e4dcdeec57f7f338067ad2d5a3e9a1822bd62aff19a12c8438f7243'
AND (
token = 'UMdcJWJ9qEPEC0FfVKHDPkY68zlHVJRpdmZU5YlTeNc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)