UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P8AGcfkoVe0CXUWmLR4iykpT/uQ5c3tOTT0/O+lfh1E=' 
WHERE 
  key_id = '884c5bbc3c330a584c90e8111f42c1c53c058301e202e95921424fdeaee41dcb' 
  AND (
    token = 'P8AGcfkoVe0CXUWmLR4iykpT/uQ5c3tOTT0/O+lfh1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044