UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DkljFRubqj4Nplyw7/IZeVRy9Zeyn6WDvcxrQKUckgU=' 
WHERE 
  key_id = '6ef4fe6facca93f25672a9ea2ca342a3cc6160c7d5fb93a9a33a13ef1f05171f' 
  AND (
    token = 'DkljFRubqj4Nplyw7/IZeVRy9Zeyn6WDvcxrQKUckgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041