UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AraD6Vad00VAoPmtbFmJb0Tyw4qFtcs5DqgCW+cGyo4=' 
WHERE 
  key_id = 'ef901e652968c6de600b547d520d7766571a6055234df5dcc8410d2fb845481b' 
  AND (
    token = 'AraD6Vad00VAoPmtbFmJb0Tyw4qFtcs5DqgCW+cGyo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017