UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TtSFvha5vfUeAJ77BHUFomupv/uLxkfCkRftkmETLt0='
WHERE
key_id = 'd1b92c265c891cc59279dcbc4690b82795c9143f472aa116b0427c075361f3fb'
AND (
token = 'TtSFvha5vfUeAJ77BHUFomupv/uLxkfCkRftkmETLt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)