UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S6/+x1m+8LeOzpt64eNtiTQPQzLOrYUXvYewHHPm1hs='
WHERE
key_id = '00b8e0d6d8d25890cbfddf9df9d3aaf0143d656f10d713f9ce95db19b142559b'
AND (
token = 'S6/+x1m+8LeOzpt64eNtiTQPQzLOrYUXvYewHHPm1hs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)