UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uHyw1Zck/yQKOHgvBFmsHWsEO9G+Gs/FDqeorEbGNhY=' 
WHERE 
  key_id = 'eb01dd7a27a5b3889344201acbd4123ee38cf794a987ebb5e930ed880b6cafff' 
  AND (
    token = 'uHyw1Zck/yQKOHgvBFmsHWsEO9G+Gs/FDqeorEbGNhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025