UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FG5zGdP/Bt6QNYPZmx+mkCArjzWDxgwY8Kx9v3FHXkw=' 
WHERE 
  key_id = 'd34cb35c94b53df182ce075b86ac7fcab0679043ef32009f6b5680703a2dc251' 
  AND (
    token = 'FG5zGdP/Bt6QNYPZmx+mkCArjzWDxgwY8Kx9v3FHXkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025