UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jmNCSck00hOnOB8RbzbaC+5NShbE6ywPhNuQ2BR4N7w='
WHERE
key_id = '285983b7a08f36712bd6123498949b8b015f4cd4a5a35247ffd721a966329159'
AND (
token = 'jmNCSck00hOnOB8RbzbaC+5NShbE6ywPhNuQ2BR4N7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)