UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qOhRJJn82yR9YTxtltY3PtQ01otORHP/9Qy2AQ2ZXK4='
WHERE
key_id = '03e51887d50d89a5ece5b9262b97a79672d56adaebf3e7fc67f6630fd85bac42'
AND (
token = 'qOhRJJn82yR9YTxtltY3PtQ01otORHP/9Qy2AQ2ZXK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)