UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xYT5oD9TL1Hfjv1afKmoyundakpDC5FVQmc479ZB5ns=' 
WHERE 
  key_id = '015b243b87a23a9d414a9e5543053158123a62aa269678b8ebfff5d2dfddd76f' 
  AND (
    token = 'xYT5oD9TL1Hfjv1afKmoyundakpDC5FVQmc479ZB5ns=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027