UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tMVT3HB6fp75lDoeVhlYov81Apjt4kabY5CuJ6E7I6A='
WHERE
key_id = '95ff1fce7e2c4413802e93314611adf7efd9b80e35dea2bfeb9fc05c104edb38'
AND (
token = 'tMVT3HB6fp75lDoeVhlYov81Apjt4kabY5CuJ6E7I6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)