UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qNaHPHJPFKo4pidls0zFO4gWJU7mBKYzuNno2qmESds='
WHERE
key_id = '8075fc895ccfdd4ebfa3d64c564410decb1642cd45d9abb9664f3035aeb0c004'
AND (
token = 'qNaHPHJPFKo4pidls0zFO4gWJU7mBKYzuNno2qmESds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)