UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0/fDXtckBe/r3joKFa9TGHOaj+LtwwVSpdk0DdvmU3E=' 
WHERE 
  key_id = '03f59148338fe2406fa091201aa14a98209e0a70167ba64f08e60871a7032bd1' 
  AND (
    token = '0/fDXtckBe/r3joKFa9TGHOaj+LtwwVSpdk0DdvmU3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015