UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GnRYYME3pbAGCcm/cSFTi5bTggzH78o39ELyIv7a8ag='
WHERE
key_id = '81a603b0c557810e137122b16004c54a34de1c94ee46f9913266050417528436'
AND (
token = 'GnRYYME3pbAGCcm/cSFTi5bTggzH78o39ELyIv7a8ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)