UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zfDGuHd2DvtVZ+TrZNdrPrzuljnGiGD/bz7/4PTsPA8=' 
WHERE 
  key_id = 'a8a74ffa0d535818f6e23037b52d560cab597bb1aca0d80c484ef4b19abe889c' 
  AND (
    token = 'zfDGuHd2DvtVZ+TrZNdrPrzuljnGiGD/bz7/4PTsPA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052