UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8LYHaxZJUmN0Vq8Fm5jIZnm9bM69zii0WeL8YDatZ2Q=' 
WHERE 
  key_id = '9ddcc2fd021cf3e98f2f303f10916c2fece23b0edb8da036bb738af16f54ef5a' 
  AND (
    token = '8LYHaxZJUmN0Vq8Fm5jIZnm9bM69zii0WeL8YDatZ2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039