UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QhU+Ie9q7WEGr3Zvvk1yhNzL1Bb7oz59I9OXxYgZ7EU=' 
WHERE 
  key_id = '58fb86cd6096747689525afa770758e2e20e7d5e5a136898f9aeb832670de52f' 
  AND (
    token = 'QhU+Ie9q7WEGr3Zvvk1yhNzL1Bb7oz59I9OXxYgZ7EU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027