UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j2x2f7nPaJC4i7+9NQ73vUsK/TXt9VKBX9/vrenMP94='
WHERE
key_id = '0cc972e158770954a487ee46767f5ec66c2d6ec63e2b51a2c10e12afc5aaf5bc'
AND (
token = 'j2x2f7nPaJC4i7+9NQ73vUsK/TXt9VKBX9/vrenMP94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)