UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SjkGCl3TdT70fII1GRmLde3LMB/UyeIfvTQqToui19M='
WHERE
key_id = 'b559a047f09e73c6386f1f65b936a4d1bbf627ba686b74509c354c7d728f1788'
AND (
token = 'SjkGCl3TdT70fII1GRmLde3LMB/UyeIfvTQqToui19M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)