UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SYPDnZJkY8WRQQlpM8C4/3qJAfsze1/r4YHTeErlQ/Y=' 
WHERE 
  key_id = 'fed6e4c2871e678aada2630197c92f199b3d4a6d4adda316a9371d791a2864eb' 
  AND (
    token = 'SYPDnZJkY8WRQQlpM8C4/3qJAfsze1/r4YHTeErlQ/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032