UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PHHj+vHQzDxx1V7owohZWJucIiSjQR0kgurqXw5NPc8='
WHERE
key_id = 'e6fcb176c5c6d1ecfdf214220836528a25d623083b8a5296ed0b2ff1963a213c'
AND (
token = 'PHHj+vHQzDxx1V7owohZWJucIiSjQR0kgurqXw5NPc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)