UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RFycLBdu7mdi9rv88QnaPD5858CTUIGkZvyBcIfmJbA=' 
WHERE 
  key_id = 'f0330e35dc591add97b90245c96b9ea19975eb48363ec12cd925ef1c6aa58eac' 
  AND (
    token = 'RFycLBdu7mdi9rv88QnaPD5858CTUIGkZvyBcIfmJbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037