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

Query time 0.00036