UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xWoj6Z2TNv/Xf7X3hNUkDf5beYWiwreuVrs0EK+r4xY=' 
WHERE 
  key_id = 'dc7f34587699bb7c7449015de5e63343f9a2c876c33e786ebc8d7a1f4b431cc9' 
  AND (
    token = 'xWoj6Z2TNv/Xf7X3hNUkDf5beYWiwreuVrs0EK+r4xY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032