UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'awPIQneXPQzFN4qYXrnvhuhQJ1q/Fw9YmzzZevJX3/U=' 
WHERE 
  key_id = '444b0f1580ca550381fbd2546e6056391dedbfbd2a48e1127dc2cec527b98444' 
  AND (
    token = 'awPIQneXPQzFN4qYXrnvhuhQJ1q/Fw9YmzzZevJX3/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042