UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm9Pkj7tdp1VvfJEiMvpG1JSxqTj7AsbMr1m4TLhpeEw=' 
WHERE 
  key_id = '0c48635995d79b09d22e75d71fbb15f67a6a7936e24b818c4bd5bf176c8f38a9' 
  AND (
    token = 'm9Pkj7tdp1VvfJEiMvpG1JSxqTj7AsbMr1m4TLhpeEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027